#include <REGX52.H>
#include <INTRINS.H>
#include "LCD1602.h"

/**
  * @brief		延迟1ms
  * @parm		无
  * @retval		无
  */
void Delayms(unsigned int x)		//@11.0592MHz
{
	while(x--)
	{
		unsigned char i, j;
		_nop_();
		i = 2;
		j = 199;
		do
		{
			while (--j);
		} while (--i);
	}
}

void main()
{
	LCD_Init();
	LCD_ShowChar(1, 1, 'A');
	LCD_ShowString(1, 3, "Hello");
	LCD_ShowNum(1, 9, 66, 3);
	LCD_ShowHexNum(1, 13, 0x8F, 2);
	LCD_ShowSignedNum(2, 1, -32768, 5);
	LCD_ShowBinNum(2, 8, 0xAA, 8);
	LCD_ShowString(1, 20, "Hello World HaHaHa");
	LCD_ShowString(2, 25, "Are you OK?");
    while(1)
    {
        LCD_WriteCommand(0x18);
		Delayms(300);
    }
}